<?php /* Smarty version Smarty-3.1.19, created on 2017-11-15 15:54:16
         compiled from "/www/wwwroot/kq.nabaowan.cn/sdk/theme/admin/default/views/student/edit.html" */ ?>
<?php /*%%SmartyHeaderCode:11406985505a09582ab16d16-80164173%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '3a5b5a48292ca804660da8daa5964a3260bae515' => 
    array (
      0 => '/www/wwwroot/kq.nabaowan.cn/sdk/theme/admin/default/views/student/edit.html',
      1 => 1510732429,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '11406985505a09582ab16d16-80164173',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.19',
  'unifunc' => 'content_5a09582ab533a1_46985388',
  'variables' => 
  array (
    'row' => 0,
    'classes' => 0,
    'v' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5a09582ab533a1_46985388')) {function content_5a09582ab533a1_46985388($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('public/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>


<div class="main-content">

<div class="page-content">

  <div class="page-content-area" style="opacity: 0.8;"> <br>

    <div class="page-header">

      <h1> 学生管理 <small><i class="ace-icon fa fa-angle-double-right"></i> <?php if ($_smarty_tpl->tpl_vars['row']->value['id']) {?>编辑<?php } else { ?>新增<?php }?>学生 </small> </h1>

    </div>

    <div class="row">

      <div class="panel panel-default">

        <div class="panel-body table-responsive">

          <form method="post" class="form-horizontal" role="form" id="submitform" onsubmit="return false">

            <div class="form-group">

              <div class="col-md-6">

                <label class="control-label" for="name">姓名</label>

                <input type="text" class="form-control" id="name" name="name" value="<?php echo $_smarty_tpl->tpl_vars['row']->value['name'];?>
">

              </div>

            </div>

            <div class="form-group">

              <div class="col-md-6">

                <label class="control-label" for="name">班级</label>

                <select name="cid" id="cid" class="form-control">

                  <option value="">请选择</option>

                  <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_fromtemp = $_smarty_tpl->tpl_vars['classes']->value; $_from = $_smarty_tpl->tpl_vars['classes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if($_fromtemp)foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
$_smarty_tpl->tpl_vars['v']->_loop = true;
?>

                  <option value="<?php echo $_smarty_tpl->tpl_vars['v']->value['id'];?>
" <?php if ($_smarty_tpl->tpl_vars['v']->value['id']==$_smarty_tpl->tpl_vars['row']->value['cid']) {?>selected<?php }?> ><?php echo $_smarty_tpl->tpl_vars['v']->value['classes'];?>
</option>

                  <?php } ?>

                </select>

              </div>

            </div>
               <div class="form-group">
              <div class="col-md-6">
                <label class="control-label" for="name">学生类型</label>
              <select name="type" id="type" class="form-control">
                  <option value="">请选择</option>
                  <option value="1">住校生</option>
                  <option value="2">走读生</option>
                  
                </select>
              </div>
            </div>
            <div class="form-group">

              <div class="col-md-6">

                <label class="control-label" for="name">家长</label>

                <input type="text" class="form-control" id="parents" name="parents" value="<?php echo $_smarty_tpl->tpl_vars['row']->value['parents'];?>
">

              </div>

            </div>

            <div class="form-group">

              <div class="col-md-6">

                <label class="control-label" for="name">电话</label>

                <input type="text" class="form-control" id="parentsphone" name="parentsphone" value="<?php echo $_smarty_tpl->tpl_vars['row']->value['parentsphone'];?>
">

              </div>

            </div>

            <div class="form-group">

              <div class="col-md-6">

                <label class="control-label" for="appsecret">卡号</label>

                <textarea class="form-control" name="iccode"><?php echo $_smarty_tpl->tpl_vars['row']->value['iccode'];?>
</textarea>

                <input type="hidden" name="_iccode" value="<?php echo md5($_smarty_tpl->tpl_vars['row']->value['iccode']);?>
" />

              </div>

            </div>

            <div class="form-group">

              <div class="col-md-6">

                <button type="submit" class="btn btn-primary btn-lg btn-submit">提交</button>

              </div>

            </div>

          </form>

        </div>

      </div>

    </div>

  </div>

</div>

<script>

var isbusy = false;

$(function(){

	$('#submitform').validate({

		focusInvalid: true,

		rules: {

			//title: {

				//required: true

			//}

		}

	});

	$('.btn-submit').click(function(){

		if(!$('#submitform').valid())return false;

		if(isbusy)return false;

		isbusy = true;

		tooltipbox.show('正在执行操作...');

		$.post(location.href, $('#submitform').serialize(), function(res){

		    if(res.code == 1){

				location.href = '<?php echo siteurl("con=admin/student");?>
';

			}

			tooltipbox.show(res.msg);	

			isbusy = false;

		}, 'json').error(function(a, b, c){

			tooltipbox.show('数据或网络错误');

			isbusy = false;

		});

	});

});

</script> 

<?php echo $_smarty_tpl->getSubTemplate ('public/footer.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 <?php }} ?>
